<?
$tmpway="../";
REQUIRE ("../../protect/connect.php");
session_start();
REQUIRE ("terrain_var.inc");

 $_OPTION=2;
  SESSION_REGISTER("_OPTION");//enregistrement de l'ID du terrain



//------------------------------------------------------------------------------
//Pour savoir qu'on est bien en train de faire le terrain

IF (!empty($p)){
     $_CHOIX=$choixtmp; //l'id du terrai
     $_STYLE=$styletmp;

	 SESSION_REGISTER("_CHOIX");//enregistrement de l'ID du terrain
     SESSION_REGISTER("_STYLE");
}
$PAGE_TMP.="choix:$_CHOIX/style:$_STYLE";





//REQUIRE("terrain.php");
IF (!empty($p)){
        IF (empty($_CHOIX)){$_CHOIX=0;$_STYLE=0;}
        $query="select terrain_pic from uterrain where terrain_id=$_CHOIX";
        $resultat=mysql_query($query);
        $tmp=mysql_fetch_row($resultat);

	$cadre="../../images/terrain/$tmp[0]-$_STYLE.png";

$PAGE_TMP.="<table width=64 border=1 align=center cellpadding=0 cellspacing=0>
  <tr>";
$PAGE_TMP.="<td background=$cadre><div align=\"center\"><img src=\"$cadre\" alt=\"10\" width=\"64\" height=\"64\" border=\"0\"></div></td>";
$PAGE_TMP.="</tr></table>";
}



//debut du tableau
$PAGE_TMP.="<table width=64 border=1 align=center cellpadding=0 cellspacing=0>
  <tr>";
$i=0;$tmp=0;
FOREACH($TER_IMAGE AS $VAR_TMP){
        $i++;$tmp++;
       $PAGE_TMP.="<td><div align=center><a name=\"a".$TER_ID[$i]."\"></a><a href=?choixtmp=".$TER_ID[$i]."&styletmp=".$TER_STYLE[$i]."&p=a&$SID#a".$TER_ID[$i]." target=_self><img src=\"../../images/terrain/".$TER_IMAGE[$i].".png\" alt=$TER_IMAGE[$i] border=0></a></div></td>";
        IF ($tmp==5){$PAGE_TMP.="</tr> <tr>";$tmp=0;}
}

//fin du tableau
$PAGE_TMP.="</tr></table>";


mysql_close();

echo $PAGE_TMP;

?>

